using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;

using Syncfusion.Windows.Forms.Diagram; 
using KLATencor.CommonApp.Infrastructure.StateMachine;

using StateMachine_Graphical_Editor.Shapes;
using StateMachine_Graphical_Editor.Forms;
using StateMachine_Graphical_Editor.Utils;

namespace StateMachine_Graphical_Editor.Graphics_Rendering
{
    /// <summary>
    /// Provides functionality for rendering and managing state machine elements
    /// </summary>
    public interface Initializer
    {
        /// <summary>
        /// Renders the graphical representation of the logical sub states that need to be rendered
        /// </summary>
        /// <returns>The graphical Elements to attach to the board</returns>
        NodeCollection getGraphicalStateList();

        /// <summary>
        /// Retrieves the logical sub states rendered by this initializer
        /// </summary>
        /// <returns>The sub states collection</returns>
        StateCollection getLevelStates();

        /// <summary>
        /// Retrieves the root element that contains the sub states rendered by this initializer
        /// </summary>
        /// <returns>The root element</returns>
        Object getRoot();

        /// <summary>
        /// Retrieves the graphical representation of the initial sub state of this form
        /// </summary>
        /// <returns>The graphical representation of the initial sub state</returns>
        GState getInitial();

        /// <summary>
        /// Sets the owner form of the initializer
        /// </summary>
        /// <param name="owner">The owner form</param>
        void setOwner(StatesForm owner);

        /// <summary>
        /// Connects between 2 nodes that their logical states have a logical transition
        /// connecting.
        /// </summary>
        /// <param name="src">The source node - stands for the logical transition's source state</param>
        /// <param name="dst">The target node - stands for the logical transition's target state</param>
        /// <param name="name">The Transition's name to present on the board</param>
        /// <param name="currTrans">The logical transition connecting between the states</param>
        /// <returns>The graphical representation of the logical trasition</returns>
        GTransition connectNodes(Node src, Node dst, String name, Transition currTrans);

        /// <summary>
        /// Returns a graphical reresentation of a state
        /// </summary>
        /// <param name="logical">the logical state to find the graphical for</param>
        /// <returns>the graphical representation of "logical"</returns>
        GState getGraphicalState(State logical);

        /// <summary>
        /// Returns a graphical reresentation of a transition
        /// </summary>
        /// <param name="logical">the logical transition to find the graphical for</param>
        /// <returns>the graphical representation of "logical"</returns>
        GTransition getGraphicalTransition(Transition logical);

        /// <summary>
        /// Change the initial state in the current diagram
        /// </summary>
        /// <param name="newInitial">The new initial state selected</param>
        void switchInitial(GState newInitial);

        /// <summary>
        /// Checks for multiple transitions between same 2 states
        /// </summary>
        /// <param name="transition">The transition to check</param>
        /// <returns>Gtransition represeting the existing transition or null if non</returns>
        GTransition checkMultipleTransitions(Transition transition);
    }
     
}
